import 'package:flutter/material.dart';

class CircleButton extends StatelessWidget {
  final GestureTapCallback onTap;
  final Color backgroundColor;
  final IconData icon;
  final Color iconColor;
  final double iconSize;
  final double iconPadding;
  final EdgeInsetsGeometry margin;

  const CircleButton({
    Key key,
    this.backgroundColor = Colors.black54,
    this.icon = Icons.insert_emoticon,
    this.iconColor = Colors.white70,
    this.iconSize = 30.0,
    this.iconPadding = 10.0,
    this.margin = const EdgeInsets.all(0),
    this.onTap,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: onTap,
      child: Container(
        child: Icon(icon, color: iconColor, size: iconSize),
        padding: EdgeInsets.all(iconPadding),
        margin: margin,
        decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle),
      ),
    );
  }
}
